package com.chance.cc.crawler.prod.command.trigger.domain.vm.xcar.realtime;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.realtime.XcarSeriesArticleRealtimeCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.realtime.XcarSeriesPublicPraiseRealtimeCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @ClassName song
 *  * @Description TODO
 *  * @Author ding
 *  * @Date 2021/8/29 10:11
 *  * @Version 1.0
 *  * 爱卡车系页文章采集
 **/
public class XcarSeriesScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
        publishXcarSeriesArticleRealtimeScheduleTriggerInfo();
       //publishXcarSeriesArticleRealtimeScheduleTriggerInfoTest();//测试

   }

    public static void publishXcarSeriesArticleRealtimeScheduleTriggerInfoTest(){
        CrawlerJob crawlerJob = XcarSeriesArticleRealtimeCrawlerScheduleJob.xcarCwalerJob();
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                XcarSeriesPublicPraiseRealtimeCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "爱卡汽车页车系文章 测试");
        System.out.println("添加采集调度： "+page.getRawText());
    }

    public static void publishXcarSeriesArticleRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = XcarSeriesArticleRealtimeCrawlerScheduleJob.xcarCwalerJob();
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                XcarSeriesPublicPraiseRealtimeCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "爱卡汽车车系页文章每天1点定时采集");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
